import java.util.Scanner;

public class demo011 {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入一个数");
        int a= scan.nextInt();
        int c = 1;
        int sum = 0;
        for (int i = 1; i <= a; i++) {
            c*=i;
            sum+=c;
        }
        System.out.println(c);
        System.out.println(sum);

    }


}

